from ewili.stock.mootdx import init_tdx, minutes, fenjia, \
    amounts_minute

client, reader = init_tdx("D:/new_tdx")
# 写入新板块
# reader.block_new(name='最优盈利板块', symbol=['600001', '600002', '600003', '600004'])
symbol = "000338"
klines = client.k(symbol=symbol, begin="2022-11-02", end="2022-11-15")
print(klines)
# 分笔成交
# df = get_transactions(client, '000606', '20220704')
# print(df)

# 分时成交
pds = minutes(client, symbol, klines['date'], '%Y-%m-%d', '%Y%m%d')
print(pds)

pds = amounts_minute(pds)
print(pds)

mds = fenjia(pds)
print(mds)
